class Data {
	// 获取舞台的宽高

	public static getStageW(): number {
		return egret.MainContext.instance.stage.stageWidth;
	}
	public static getStageH(): number {
		return egret.MainContext.instance.stage.stageHeight;
	}

	// 设置显示对象的锚点
	public static setAnchorOffset(obj, x, y) {
		obj.anchorOffsetX = x;
		obj.anchorOffsetY = y;
		return obj;
	}

	// 排序函数
	public static bTos: (a: any, b: any) => number = function (a, b) {
		var va = parseInt(a.val);
		var vb = parseInt(b.val);
		if (va === vb) {
			return a.type > b.type ? 1 : -1;
		} else if (va > vb) {
			return -1;
		} else {
			return 1;
		}
	}
	// 玩家名称
	public static playerNameArr = ['left-player', 'right-player', 'my-player'];
	// 记录当前局的地主
	public static currentLandlord: Player;

	// 沉睡
	// 实现sleep函数
	public static sleep(ms) {
		return new Promise(resolve => setTimeout(resolve, ms))
	}
	// 记录所有的玩家
	public static playerArr = [];
}